<!-- Header Area -->
<headerbar></headerbar>

<!-- navbar Ara -->
<navbar></navbar>

<div class="mainbody">
    <div class="maincontent row">
        <!--我是主要内容 start-->
        <div class="col-sm-12">
            <div class="jumbotron">
                <div class="col-sm-2 "></div>
                <h2 class="text-center">The List Of Advert</h2>
                <p class="text-center">odperated advert : reject Or on Or down</p>
            </div>
        </div>
        <div ng-controller="advertController as vm">
            <ul class="nav nav-tabs" ng-init="vm.activeTab=1" style="padding-left: 150px;">
                <li ng-click="vm.untreat()" ng-class="{active: vm.activeTab == 1}"><a href="javascript:;" ng-click="vm.activeTab = 1" >untreated</a></li>
                <li ng-click="vm.processe()" ng-class="{active: vm.activeTab == 2}"><a href="javascript:;" ng-click="vm.activeTab = 2" >processed</a></li>
                <li ng-click="vm.onput()" ng-class="{active: vm.activeTab == 3}"><a href="javascript:;" ng-click="vm.activeTab = 3" >on Or down</a></li>
            </ul>
            <div class="tab-content tab-bordered">
                <div class="tab-panel" ng-show="vm.activeTab == 1">
                    <!--我是主要内容 end-->
                    <div class="col-sm-1"></div>
                    <div class="col-sm-9">
                        <table class="table table-hover table-condensed">
                            <thead>
                                <tr>
                                    <th rowspan="1"><input type="checkbox" ng-model="vm.allChecked" ng-change="vm.checkAll(vm.allChecked)"
                                        /></th>
                                    <th rowspan="1">merchant-name</th>
                                    <th rowspan="2">food-pic</th>
                                    <th rowspan="1">food-name</th>
                                    <th rowspan="2">price</th>
                                    <th rowspan="1">operate</th>
                                    <th rowspan="2">apply-time</th>
                                </tr>
                            </thead>

                            <tbody>
                                <tr ng-repeat="item in vm.untreatedadvertlist">
                                    <td><input type="checkbox" ng-model="item.$checked" /></td>
                                    <td>{{item.merchant.name}}</td>
                                    <td><img style="width:50px;" ng-src='{{item.picUrl}}' class="text-center"></td>
                                    <td>{{item.food}}</td>
                                    <td>{{item.price}}</td>
                                    <td>
                                        <button class="btn btn-success" ng-click="vm.update('0', '1', $index)">On</button>
                                        <button class="btn btn-warning" ng-click="vm.update('0', '2', $index)">Reject</button>
                                        <button class="btn btn-danger" ng-click="vm.update('0', '3', $index)">Block</button>
                                    </td>
                                    <td>{{item.applyTime | date: 'yyyy-MM-dd HH:mm:ss' }}</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="tab-panel" ng-show="vm.activeTab == 2">
                    <!--我是主要内容 end-->
                    <div class="col-sm-1"></div>
                    <div class="col-sm-9">
                        <table class="table table-hover table-condensed">
                            <thead>
                                <tr>
                                    <th rowspan="1"><input type="checkbox" ng-model="vm.allChecked" ng-change="vm.checkAll(vm.allChecked)"
                                        /></th>
                                    <th rowspan="1">merchant-name</th>
                                    <th rowspan="2">food-pic</th>
                                    <th rowspan="1">food-name</th>
                                    <th rowspan="2">price</th>
                                    <th rowspan="1">status</th>
                                    <th rowspan="2">apply-time</th>
                                    <th rowspan="2">review-time</th>
                                </tr>
                            </thead>

                            <tbody>
                                <tr ng-repeat="item in vm.processedlist">
                                    <td><input type="checkbox" ng-model="item.$checked" /></td>
                                    <td>{{item.merchant.name}}</td>
                                    <td><img style="width:50px;" ng-src='{{item.picUrl}}' class="text-center"></td>
                                    <td>{{item.food}}</td>
                                    <td>{{item.price}}</td>
                                    <td ng-if="item.status==1" style="color:green">Be On</td>
                                    <td ng-if="item.status==2" style="color:orange">Be Reject</td>
                                    <td ng-if="item.status==3" style="color:red">Be down</td>
                                    <td>{{item.applyTime | date: 'yyyy-MM-dd HH:mm:ss' }}</td>
                                    <td>{{item.reviewTime | date: 'yyyy-MM-dd HH:mm:ss' }}</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="tab-panel" ng-show="vm.activeTab == 3">
                    <!--我是主要内容 end-->
                    <div class="col-sm-1"></div>
                    <div class="col-sm-9">
                        <table class="table table-hover table-condensed">
                            <thead>
                                <tr>
                                    <th rowspan="1"><input type="checkbox" ng-model="vm.allChecked" ng-change="vm.checkAll(vm.allChecked)"
                                        /></th>
                                    <th rowspan="1">merchant-name</th>
                                    <th rowspan="2">food-pic</th>
                                    <th rowspan="1">food-name</th>
                                    <th rowspan="2">price</th>
                                    <th rowspan="1">status</th>
                                    <th rowspan="1">operate</th>
                                    <th rowspan="2">apply-time</th>
                                    <th rowspan="2">review-time</th>
                                </tr>
                            </thead>

                            <tbody>
                                <tr ng-repeat="item in vm.onputlist">
                                    <td><input type="checkbox" ng-model="item.$checked" /></td>
                                    <td>{{item.merchant.name}}</td>
                                    <td><img style="width:50px;" ng-src='{{item.picUrl}}' class="text-center"></td>
                                    <td>{{item.food}}</td>
                                    <td>{{item.price}}</td>
                                    <td ng-if="item.status==1" style="color:green">On</td>
                                    <td ng-if="item.status==3" style="color:red">Down</td>

                                    <td ng-if="item.status==3">
                                        <button class="btn btn-success" ng-click="vm.update('1', '1', $index)">On</button>
                                    </td>
                                    <td ng-if="item.status==1">
                                        <button class="btn btn-danger" ng-click="vm.update('1', '3', $index)">Down</button>
                                    </td>
                                    <td>{{item.applyTime | date: 'yyyy-MM-dd HH:mm:ss' }}</td>
                                    <td>{{item.reviewTime | date: 'yyyy-MM-dd HH:mm:ss' }}</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>


    </div>
</div>